-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Use jupyter-black
pre-commit hook over nbqa-black
#1598
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1598 +/- ##
=======================================
Coverage 97.70% 97.70%
=======================================
Files 63 63
Lines 4050 4050
Branches 576 576
=======================================
Hits 3957 3957
Misses 54 54
Partials 39 39
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
.pre-commit-config.yaml
Outdated
- id: black | ||
- id: black-jupyter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
black-jupyter
will run on Python and pyi
files as well, you probably only need that one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's awesome. :)
* Remove .coveragerc and consolidate pytest options to pyproject.toml. * Apply 'configuring pytest' recommendations for pytest from Scikit-HEP (c.f. https://scikit-hep.org/developer/pytest#configuring-pytest ). - '-ra' includes a report after pytest runs with a summary on all tests except those that passed. From 'pytest --help': > -r chars: show extra test summary info as specified by chars: (f)ailed, > (E)rror, (s)kipped, (x)failed, (X)passed, (p)assed, (P)assed with output, > (a)ll except passed (p/P), or (A)ll. (w)arnings are enabled by default > (see --disable-warnings), 'N' can be used to reset the list. (default: 'fE'). - '--showlocal' prints locals in tracebacks. - '--strict-markers' will complain if you use an unspecified fixture. - '--strict-config' will raise an error if there is a mistake in the pytest config. - 'log_cli_level = "info"' reports INFO and above log messages on a failure. - 'filterwarnings = ["error"]' sets all warnings to be errors and allows for some warnings to be ignored with -W warn control syntax. (c.f. https://docs.python.org/dev/using/cmdline.html#cmdoption-W ) * Remove `tests/__init__.py` as no reason to make the tests directory importable. * Remove '-r sx' from pytest calls in CI jobs as pyproject.toml now applies '-ra'. * Use 'with pytest.warns' to assert expected warnings in tests. (c.f. https://docs.pytest.org/en/7.0.x/how-to/capture-warnings.html#warns ) * Override error on filterwarnings for the 'minimum supported dependencies' GHA workflow as it is testing for the oldest releases that work with the latest API, not the oldest releases that are warning free. * Remove unused nbQA options for black from pyproject.toml. - Amends PR #1598
Description
Resolves #1594
Wit the addition of the
jupyter-black
hook by @MarcoGorelli (c.f. psf/black#2357) inblack
v21.8b0
thenbqa-black
hook has essentially been contributed to Black and nownbqa-black
is no longer needed. This has the additional advantage of being tied to the Black version directly and doesn't require updating the Black version as anadditional_dependencies
ofnbqa-black
and also that theblack
hook id is now also contained inblack-jupyter
.Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: